const { init, parse } = require('es-module-lexer')
;(async () => {
  await init
  const [imports, exports] = parse(`import _ from 'lodash';\nexport var p = 5`)
  console.log(imports)
  console.log(exports)
})()

// [ { n: 'lodash', s: 15, e: 21, ss: 0, se: 22, d: -1, a: -1 } ]
// [ { s: 35, e: 36, ls: 35, le: 36, n: 'p', ln: 'p' } ]
